package model
{
	//奖金池信息
	
	import flash3.framework.MapManager;
	import flash3.framework.Singleton;
	
	import vo.MoneyPoolItem;
	
	public class PrizePoolModel extends MapManager
	{
		public function PrizePoolModel()
		{
			super();
		}
		
		static public function get i():PrizePoolModel
		{
			return Singleton.getInstanceOrCreate(PrizePoolModel) as PrizePoolModel;
		}
		
		public function parseJson(data:Object):void
		{
			var items:Array = data as Array;
			var serverID:uint;
			var kindID:uint;
			for(var i:uint = 0; i < items.length; i++)
			{
				var item:Object = items[i];
				serverID = item.serverid;
				kindID = item.kindid;
				var moneyPoolItem:MoneyPoolItem = this.value(serverID);
				var hasItem:Boolean = moneyPoolItem!=null;
				if(!moneyPoolItem)
					moneyPoolItem = new MoneyPoolItem();
				moneyPoolItem.parseJson(item);
				if(!hasItem)
					add(serverID, moneyPoolItem);
			}
		}
	}
}